<template>
  <div
    v-if="contentStore.isShowModuleBox"
    :class="`animate__animated ${
      contentStore.currentScrollDirection == 'bottom'
        ? 'animate__fadeInDown'
        : 'animate__fadeInUp'
    } main_content_wrap  ${contentStore.checkCategoryCount}`"
  >
    <div
      class="modulle_item_box"
      v-for="(m, indexM) in contentStore.showModules"
      :key="indexM"
      @click="moduleClick(m)"
    >
      <img class="module_img" :src="imgUrlJoin(m.imgFileType, m.imgFileName)" />

      <span class="module_name">{{ m.moduleName }}</span>
    </div>
  </div>
</template>

<script>
import { defineComponent, onMounted, ref } from "vue";
import "./index.scss";
export default defineComponent({
  name: "MainContent",
});
</script>
<script setup>
import { imgUrlPrefix } from "@/libs/baseUrl.js";
import { useContentStore } from "@/store";

const contentStore = useContentStore();

// 图片地址拼接
const imgUrlJoin = (type, name) => {
  return `${imgUrlPrefix}${name}.${type}`;
};

// 模块列表
const moduleList = ref([]);

const moduleClick = (module) => {
  window.open(module.linkUrl);
};

onMounted(() => {});
</script>

<style lang="scss" scoped></style>
